#pragma once
#include "Board.h"
#define TRUE 1
#define FALSE 0
#define LEFT_BORDER 0
#define RIGHT_BORDER 3

typedef int boolean;

typedef struct Coordinates {
	int row; // y, i
	int column; // x, j
	char dir;
	int movePosibility;
} Coordinates;

typedef struct forcibleMoveFields {
	Field Current;
	Field Left1;
	Field Left2;
	Field Right1;
	Field Right2;
} forcibleMoveFields;

typedef struct movePosibilityFields {
	Field Current;
	Field Left1;
	Field Left2;
	Field Right1;
	Field Right2;
} movePosibilityFields;

typedef struct borderFields {
	Field Current;
	Field Left;
	Field Right;
} borderFields;

void getCoordinates(Board *pBoard, Coordinates *pCoordinates, int *pTurn);
void setCoordinates(Board *pBoard, Coordinates *pCoordinates, int *pTurn);
int setRow(Coordinates *pCoordinates);
int setColumn(Coordinates *pCoordinates);
void checkRowInput (Coordinates *pCoordinates);
void checkColumnInput(Coordinates *pCoordinates);
char chooseDirection(Coordinates *pCoordinates);
void checkDirectionInput(Coordinates *pCoordinates);
void seeChecker(Board *pBoard, Coordinates *pCoordinates, int *pTurn);
void setForcibleFields(Board *pBoard, int *pTurn, int i, int j, forcibleMoveFields *pForcibleFields);
boolean checkForcibleEndTurn(Board *pBoard, int *pTurn, forcibleMoveFields *pForcibleFields, int *pForcibleEndTurn);
boolean checkForcibleMove(Board *pBoard, int *pTurn);
void forcibleMove(Board *pBoard, int *pTurn, int i, int j, forcibleMoveFields *pForcibleFields);
boolean checkMoveBlock(Board *pBoard, int *pTurn, Coordinates *pCoordinates);
void setMoveBlockFields(Board *pBoard, int *pTurn, Coordinates *pCoordinates, movePosibilityFields *pMoveFields);
boolean checkBorder(Board *pBoard, int *pTurn, Coordinates *pCoordinates);
void setBorderFields(Board *pBoard, int *pTurn, Coordinates *pCoordinates, borderFields *pBorderFields);
boolean checkMovementPosibility(Board *pBoard, int *pTurn, Coordinates *pCoordinates);
void moveChecker(Board *pBoard, int *pTurn, Coordinates *pCoordinates);

boolean isForcibleMoveBlock(Board *pBoard, int *pTurn, int i, forcibleMoveFields *pForcibleFields, boolean *pForcibleBlock);







		//if(pForcibleFields->Left1.state == STATE_OPPOSITE && pForcibleFields->Left2.state == STATE_EMPTY &&
		//	pForcibleFields->Current.x != LEFT_BORDER && pForcibleFields->Left1.x != RIGHT_BORDER) {// bicie w lewo


		//	else if(pForcibleFields->Right1.state == STATE_OPPOSITE && pForcibleFields->Right2.state == STATE_EMPTY &&
		//		pForcibleFields->Current.x != RIGHT_BORDER && pForcibleFields->Right1.x != LEFT_BORDER) {//bicie w prawo